//import Vue from 'vue'

var app={
    "helloA":function () {
        require.ensure(['./a'],function(require){
            var a=require('./a');
            a.sayHello();
        }, 'common');

    },
    "helloB":function () {
        require.ensure(['./b'],function(require){
            var b=require('./b');
            b.sayHello();
        }, 'common');

    }
}

require.ensure(['./Address.vue'],function(require){
    var Address=require('./Address.vue');
    new Vue({
        el: '#app',
        template:'<div><Address></Address>' +
        '<button @click="callEnsureA">调用A</button><button  @click="callEnsureB">调用B</button></div>',
        components:{
            "Address":Address
        },
        methods:{
            callEnsureA:function(){
                app.helloA();
            },
            callEnsureB:function(){
                app.helloB();
            }
        }
    })

}, 'common');





